<template>
  <div class="home">
    <!-- <h2>App当前计数:{{ $store.state.counter }}</h2> -->
    <h2>App当前计数:{{storeCounter}}</h2>
    <button @click="add">+1</button>
  </div>
</template>

<!-- <script>
export default {
  computed: {
    storeCounter() {
      return this.$store.state.counter
    },
  },
}
</script> -->

<script setup>
import { useStore } from 'vuex'
const store = useStore()
function add() {
  // console.log('111111111')
  // store.state.counter++
   store.commit("add")
}

</script>

<style scoped></style>
